/**
 * Title: JsonRequestParams.java
 * Description:
 * Copyright: Copyright (c) 2008
 * Company:深圳彩讯科技有限公司
 * Author 罗旭东 (hi@luoxudong.com)
 * Date 2013-8-15 下午3:16:48
 * Version 1.0 
 */
package com.luoxudong.phonenumber.service.net.http.asynchttp;

import com.google.gson.Gson;
import com.luoxudong.phonenumber.service.net.http.httpclient.Consts;
import com.luoxudong.phonenumber.service.net.http.httpclient.HttpEntity;
import com.luoxudong.phonenumber.service.net.http.httpclient.entity.StringEntity;
import com.luoxudong.phonenumber.service.utils.EvtLog;

/** 
 * ClassName: JsonRequestParams
 * Description:json请求参数
 * Create by 罗旭东
 * Date 2013-8-15 下午3:16:48
 */
public class JsonRequestParams<T> extends RequestParams{
	private static final String TAG = "JsonRequestParams";
	protected T requestJsonObj = null;
	
	@Override
	public HttpEntity getEntity() {
		Gson gson = new Gson();
    	String requestData = gson.toJson(getRequestJsonObj());
    	EvtLog.i(TAG, requestData);
    	return new StringEntity(requestData, Consts.UTF_8);
	}

	public T getRequestJsonObj() {
		return requestJsonObj;
	}

	public void setRequestJsonObj(T requestJsonObj) {
		this.requestJsonObj = requestJsonObj;
	}
	
}
